package com.icehand.json.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * gson
 * @author zhoujunmei
 * @date 2019-08-02 10:19
 * @remark
 */
public class GsonUtil {
    private static Gson gson = new GsonBuilder().create();

    public static String toJSONString(Object object){
        return gson.toJson(object);
    }

    public static <T> T toObject(String string, Class<T> clazz) {
        return gson.fromJson(string, clazz);
    }
}
